<!DOCTYPE html>
<html lang="en" class="no-js" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorator="layout">
<head>
<title>秒杀团购商品管理</title>
</head>
<body>
<div layout:fragment="content">
	<div class="row">
		<div class="col-md-12">
			<div class="btn-group pull-right">
				<a href="index.html" th:href="@{'/promotion/seckillgroupbuygoods/index/'+${secKillGroupBuyId}}" id="sample_editable_1_new" class="btn green">返回<i class="fa fa-arrow-circle-o-left"></i></a>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-md-12">
			<div class="form">
				<form role="form" th:action="@{'/promotion/seckillgroupbuygoods/save/'+${secKillGroupBuyId}}" th:object="${skgbgood}" id="skgbForm" method="post" class="form-horizontal">
					<h4 class="form-section">秒杀团购商品信息</h4>
					<input type="hidden" th:field="*{id}" />
					<div class="form-body">
						<div class="form-group">
							<label class="control-label col-md-3">商品名称</label>							
							<div class="col-md-4">
								<div th:text="${skgbgood.goods.name}"></div>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-md-3">限购数量<span class="required" aria-required="true">* </span></label>							
							<div class="col-md-4">
								<input type="text" class="form-control" placeholder="限购数量" th:field="*{goodsNumber}"/>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-md-3">活动价格<span class="required" aria-required="true">* </span></label>							
							<div class="col-md-4">
								<input type="text" class="form-control" placeholder="活动价格" th:field="*{goodsPrice}"/>
							</div>
						</div>


					</div>
					<div class="form-actions fluid">
						<div class="col-md-offset-3 col-md-9">
							<button id="bt_submit" type="submit" class="btn blue">提交</button>
						</div>
					</div>
				</form>		
			</div>
		</div>
	</div>
</div>	
</body>
</html>
<script th:inline="javascript">
    /*<![CDATA[*/
       $(document).ready(function(){
    	   $("#skgbForm").validate({
               rules:{
            	   goodsNumber:{
            		  required:true,
                      digits:true,
                      min:0,
                      max:99999999
                   },
            	   goodsPrice:{
                       required:true,
                       number:true,
                       min:1,
                       max:99999999.99
                   }

               },
               messages:{
            	   goodsNumber:{
                       required:"请输入商品限购数量",
                       number:"请输入正确的数量"
                   },
            	   goodsPrice:{
                       required:"请输入商品活动金额",
                       number:"请输入正确的金额",
                       min:"活动价格不能小于0"
                   }
                   

               }
           });
       });
       
        /*]]>*/
</script>